<?php

declare(strict_types=1);

namespace App\CustHub\Model;

use Mine\MineModel;

/**
 * @property int $id 
 * @property int $uid 
 * @property int $main_uid 
 * @property int $group_id 分组ID
 * @property int $robot_id 机器人ID
 * @property int $status 状态（1=启用，2 = 停用）
 * @property int $hello_time 今日打招呼次数
 * @property int $max_time 最大次数
 * @property string $created_at 
 * @property string $updated_at 
 * @property-read null|ChRobot $robot 
 */
class ChAddFriendRobot extends MineModel
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'ch_add_friend_robot';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'uid', 'main_uid', 'group_id', 'robot_id', 'status', 'hello_time', 'max_time', 'created_at', 'updated_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'uid' => 'integer', 'main_uid' => 'integer', 'group_id' => 'integer', 'robot_id' => 'integer', 'status' => 'integer', 'hello_time' => 'integer', 'max_time' => 'integer'];

    public function robot()
    {
        return $this->belongsTo(ChRobot::class, 'robot_id', 'id');
    }
}
